<template>
  <div>
           <button @click="getList">123</button>
           <div>{{user}}</div>
  </div>
</template>

<script>
export default {
data() {
  return {
  //        list:[{name:'张三',address:[{dart:"四川省",city:[{cityList:"成都市",county:[{countyList:"清凤时代城"}]}]}]}]
        // list:[ [1, 2, 2], [3, 4, 5, 5], [6, 7, 8, 9, [11, 12, [12, 13, [14] ] ] ], 10]
        list:[[{name:"张三"}],[{name:"李四"}]]
  }

},
methods:{
   getList(){
       console.log([...this.list])
   }
},
computed:{
  user(){
    // return `${this.list.map(item=>item.name)} 
    // ${this.list.map(item=>item.address.map(xx=>xx.dart))}
    //  ${this.list.map(item=>item.address.map(xx=>xx.city.map(cc=>cc.cityList)))}
    //  ${this.list.map(item=>item.address.map(xx=>xx.city.map(cc=>cc.county.map(bb=>bb.countyList))))}
    // ` 
//  return Array.from(this.list.flat(Infinity))
        //  .flat(Infinity);
 
const str = `[${JSON.stringify(this.list).replace(/(\[|\])/g, '')}]`
JSON.parse(str)   // [1, 1, 2, 1, 2, 3]
  }

},
mounted(){
  // this.user()  
},
}
</script>

<style>

</style>>